QR code

A QR code (abbreviated from Quick Response code) is a type of matrix barcode (or two-dimensional code) first designed for the automotive industry. More recently, the system has become popular outside of the industry due to its fast readability and comparatively large storage capacity. The code consists of black modules arranged in a square pattern on a white background. The information encoded can be made up of four standardized kinds ("modes") of data (numeric, alphanumeric, byte/binary, Kanji), or by supported extensions virtually any kind of data.[1]

Created by Toyota subsidiary Denso Wave in 1994[2] to track vehicles during the manufacturing process, the QR code is one of the most popular types of two-dimensional barcodes. It was designed to allow its contents to be decoded at high speed.[3]

The technology has seen frequent use in the United States; QR usage is growing fastest in Canada and Hong Kong.[4]

Contents

Standards

There are several standards in documents covering the physical encoding of QR codes:[5]

At the application layer, there is some variation between implementations. NTT DoCoMo has established de facto standards for the encoding of URLs, contact information, and several other data types.[7] The open-source "ZXing" project maintains a list of QR code data types.[8]

Design

Storage

The amount of data that can be stored in the QR code symbol depends on the datatype (mode, or input character set), version (1,...,40, indicating the overall dimensions of the symbol), and error correction level (L[ow], M[edium], Q[uality], H[igh]). The maximum storage capacities occur for 40-L symbols (version 40, error correction level L), and are as follows (where character refers to individual values of the input mode/datatype, as indicated):[3][9]

Numeric only Max. 7,089 characters (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
Alphanumeric Max. 4,296 characters (0–9, A–Z [upper-case only], space, $, %, *, +, -, ., /, :)
Binary/byte Max. 2,953 characters (8-bit bytes)
Kanji/Kana Max. 1,817 characters

Here are some sample QR code symbols:

Encryption

Although encrypted QR codes are not very common, there are a few implementations. An Android app,[10] for example, manages encryption and decryption of QR codes using DES algorithm (56 bits).[11] Japanese immigration use encrypted QR codes when placing visas in passports.

Error correction

Codewords are 8 bits long and use the Reed–Solomon error correction algorithm with four error correction levels. The higher the error correction level, the less storage capacity. The following table lists the approximate error correction capability at each of the four levels:

Level L 7% of codewords can be restored.
Level M 15% of codewords can be restored.
Level Q 25% of codewords can be restored.
Level H 30% of codewords can be restored.

Due to the design of Reed–Solomon codes and the use of 8-bit codewords, an individual code block cannot be more than 255 codewords in length. Since the larger QR symbols contain much more data than that, it is necessary to break the message up into multiple blocks. The largest possible block size is never used, though. The QR specification defines the block sizes so that no more than 15 errors can be corrected within each block. This limits the complexity of certain steps in the decoding algorithm. The code blocks are then interleaved together, making it less likely that localized damage to a QR symbol will overwhelm the capacity of any single block.

Thanks to error correction, it is possible to create artistic QR codes that still scan correctly, but contain intentional errors to make them more readable or attractive to the human eye, as well as to incorporate colors, logos and other features into the QR code block.[12][13]

Encoding

The format information records two things: the error correction level and the mask pattern used for the symbol. Masking is used to break up patterns in the data area that might confuse a scanner, such as large blank areas or misleading features that look like the locator marks. The mask patterns are defined on a 6×6 grid that is repeated as necessary to cover the whole symbol. Modules corresponding to the dark areas of the mask are inverted. The format information is protected from errors with a BCH code, and two complete copies are included in each QR symbol.

The message data is placed from right to left in a zigzag pattern, as shown below. In larger symbols, this is complicated by the presence of the alignment patterns and the use of multiple interleaved error-correction blocks.

Four-bit indicators are used to select the encoding mode and convey other information. Encoding modes can be mixed as needed within a QR symbol.

Indicator Meaning
0001 Numeric encoding (10 bits per 3 digits)
0010 Alphanumeric encoding (11 bits per 2 characters)
0100 Byte encoding (8 bits per character)
1000 Kanji encoding (13 bits per character)
0011 Structured append (used to split a message across multiple QR symbols)
0111 Extended Channel Interpretation (select alternate character set or encoding)
0101 FNC1 in first position (see Code 128 for more information)
1001 FNC1 in second position
0000 End of message

After each indicator that selects an encoding mode is a length field that tells how many characters are encoded in that mode. The number of bits in the length field depends on the encoding and the symbol version, as shown below.

Encoding Ver 1–9 10–26 27–40
Numeric 10 12 14
Alphanumeric 9 11 13
Byte 8 16 16
Kanji 8 10 12

Alphanumeric encoding mode stores a message more compactly than the byte mode, but cannot store lower-case letters and has only a limited selection of punctuation marks. Two characters are coded in an 11-bit value by this formula:

V = 45 × C1 + C2

Alphanumeric character codes are as follows.

Code Character Code Character Code Character Code Character Code Character
0 0 9 9 18 I 27 R 36 space
1 1 10 A 19 J 28 S 37 $
2 2 11 B 20 K 29 T 38 %
3 3 12 C 21 L 30 U 39 *
4 4 13 D 22 M 31 V 40 +
5 5 14 E 23 N 32 W 41 -
6 6 15 F 24 O 33 X 42 .
7 7 16 G 25 P 34 Y 43 /
8 8 17 H 26 Q 35 Z 44 :

License

The use of QR codes is free of any license. The QR code is clearly defined and published as an ISO standard.

Denso Wave owns the patent rights on QR codes, but has chosen not to exercise them.[5] In the USA, the granted QR code patent is US 5726435 , and in Japan JP 2938338 . The European Patent Office granted patent EP0672994B1 to Denso Wave, which was then validated into French, British and German patents, all of which are still in force as of November 2011.

The term QR code itself is a registered trademark of Denso Wave Incorporated.[14]

Variants

Micro QR code is a smaller version of the QR code standard for applications with less ability to handle large scans. There are different forms of Micro QR codes as well. The highest of these can hold 35 numeric characters.

Standard QR code is the QR code standard for applications that possess the ability to handle large scans. A standard QR code can contain up to 7,089 characters, though not all QR readers can accept that much data.

Uses

Although initially used to track parts in vehicle manufacturing, QR codes are now (as of 2011) used over a much wider range of applications, including commercial tracking, entertainment and transport ticketing, product marketing and in-store product labeling. Many of these applications target mobile-phone users (via mobile tagging). Users may receive text, add a vCard contact to their device, open a Uniform Resource Identifier (URI), or compose an e-mail or text message after scanning QR codes. They can generate and print their own QR codes for others to scan and use by visiting one of several pay or free QR code-generating sites or apps. Google has a popular API to generate QR codes,[15] and apps for scanning QR codes can be found on nearly all smartphone devices.[16]

QR codes storing addresses and Uniform Resource Locators (URLs) may appear in magazines, on signs, on buses, on business cards, or on almost any object about which users might need information. Users with a camera phone equipped with the correct reader application can scan the image of the QR code to display text, contact information, connect to a wireless network, or open a web page in the telephone's browser. This act of linking from physical world objects is termed hardlinking or object hyperlinking. QR Codes may also be linked to a location to track where a code has been scanned. Either the application that scans the QR Code retrieves the geo information by using GPS and cell tower triangulation (aGPS) or the URL encoded in the QR Code itself is associated with a location. [17]

QR codes can be used in Google's mobile Android operating system via both their own Google Goggles application or 3rd party barcode scanners like ZXing or Kaywa. The browser supports URI redirection, which allows QR codes to send metadata to existing applications on the device. Nokia's Symbian operating system features a barcode scanner which can read QR codes,[18] while mbarcode[19] is a QR code reader for the Maemo operating system. In the Apple iOS, a QR code reader is not natively included, but more than fifty paid and free apps are available with both scanning capabilities and hard-linking to URI. With BlackBerry devices, the App World application can natively scan QR codes and load any recognized Web URLs on the device's Web browser. Windows Phone 7.5 is able to scan QR codes through the Bing search app.

In the USA, QR code usage is expanding. During the month of June 2011, according to one study, 14 million mobile users scanned a QR code or a barcode. Some 58% of those users scanned a QR or bar code from their home, while 39% scanned from retail stores; 53% of the 14 million users were men between the ages of 18 and 34.[20]. QR codes are also being tested for "virtual store" formats, particularly in South Korea [21]and Argentina[22].

While the adoption of QR codes in some markets has been slow to begin (particularly in markets such as the United States, where competing standards such as Data Matrix exist), the technology is gaining some traction in the smartphone market. Many Android, Nokia, Blackberry handsets, and the Nintendo 3DS, come with QR code readers installed. QR reader software is available for most mobile platforms. Moreover, there are a number of online QR code generators which enable users to create QR codes for their own needs.

Risks

Malicious QR codes combined with a permissive reader can put a computer's contents and user's privacy at risk. They are easily created and may be affixed over legitimate QR codes.[23] On a smartphone, the reader's many permissions may allow use of the camera, full internet access, read/write contact data, GPS, read browser history, read/write local storage, and global system changes.[24][25][26]

Risks include linking to dangerous websites with browser exploits, enabling the microphone/camera/GPS and then streaming those feeds to a remote server, analysis of sensitive data (passwords, files, contacts, transactions),[27] and sending email/SMS/IM messages or DDOS packets as part of a botnet, corrupting privacy settings, stealing identity,[28] and even containing malicious logic themselves such as JavaScript[29] or a virus.[30][31] These actions may occur in the background while the user only sees the reader opening a seemingly harmless webpage.[32]

See also

References

  1. ^ "QR Code features". Denso-Wave. http://www.denso-wave.com/qrcode/qrfeature-e.html. Retrieved 03-10-2011. 
  2. ^ Borko Furht (2011). Handbook of Augmented Reality. Springer. p. 341. http://books.google.com/books?id=fG8JUdrScsYC&lpg=PP1&dq=Handbook%20of%20Augmented%20Reality&pg=PA341. 
  3. ^ a b "QR Code – About 2D Code". Denso-Wave. http://www.denso-wave.com/qrcode/aboutqr-e.html. Retrieved 03-11-2011. 
  4. ^ "Global Growth in Mobile Barcode Usage - Q4 / 2010". 3GVision. 2011-01-05. http://www.3gvision.com/pr18.html. Retrieved 2011-12-23. 
  5. ^ a b "QR Code Standardization". QR Code.com. Denso-wave.com. http://www.denso-wave.com/qrcode/qrstandard-e.html. Retrieved 23 April 2009. 
  6. ^ "AIM Global Online Store". Aimglobal.org. https://www.aimglobal.org/estore/ProductDetails.aspx?ProductID=31. Retrieved 23 April 2009. 
  7. ^ "Synchronization with Native Applications". NTT DoCoMo. http://www.nttdocomo.co.jp/english/service/imode/make/content/barcode/function/application/. Retrieved 17 February 2009. 
  8. ^ "Barcode Contents". zxing – A rough guide to standard encoding of information in barcodes. http://code.google.com/p/zxing/wiki/BarcodeContents. Retrieved 17 February 2009. 
  9. ^ "Version and Maximum capacity table". Denso-Wave. http://www.denso-wave.com/qrcode/vertable1-e.html. 
  10. ^ "QR Droid". Google. 19 Aug 11. https://market.android.com/details?id=la.droid.qr. Retrieved 05 Sep 11. 
  11. ^ "Encrypted QR codes". QR Droid. 24 Oct 11. http://qrdroid.com/encrypted-qr-codes-share-secret-messages.html. Retrieved 05 Sep 11. 
  12. ^ Orli Sharaby (2010-10-18). "Form Meets Function: Extreme Makeover QR Code Edition". http://blog.360i.com/emerging-media/creative-qr-codes. Retrieved 2011-07-29. 
  13. ^ Hamilton Chan (2011-04-18). "HOW TO: Make Your QR Codes More Beautiful". http://mashable.com/2011/04/18/qr-code-design-tips/. Retrieved 2011-07-29. 
  14. ^ "QR Code.com". Denso-wave.com. 6 November 2003. http://www.denso-wave.com/qrcode/index-e.html. Retrieved 23 April 2009. 
  15. ^ "Google Chart Tools". http://code.google.com/apis/chart/infographics/. 
  16. ^ "QR Code Readers for iPhone, Android, Blackberry and Windows Phone 7". http://www.708media.com/qrcode/qr-code-readers-iphone-android-blackberry-windows-phone-7/. 
  17. ^ "Geo Tagged QR Codes". http://qrd.by. Retrieved 27-10-2011. 
  18. ^ "Nokia Europe – Nokia N80 – Support". http://europe.nokia.com/support/product-support/nokia-n80/phone-software/smartphone. 
  19. ^ "package overview for mbarcode". Maemo.org. http://maemo.org/packages/view/mbarcode/. Retrieved 28 July 2010. 
  20. ^ August 16, 2011 http://www.internetretailing.net/2011/08/14m-americans-scanned-qr-and-bar-codes-with-their-mobiles-in-june-2011/
  21. ^ "Korea’s Tesco reinvents grocery shopping with QR-code “stores”". http://www.geek.com/articles/mobile/koreas-tesco-reinvents-grocery-shopping-with-qr-code-stores-20110628/. 
  22. ^ "Marketing futurista: ya se puede comprar con la cámara del celular". http://www.ieco.clarin.com/empresas/Marketing-futurista-comprar-camara-celular_0_555544518.html. 
  23. ^ "Malicious Images: What's a QR Code". SANS Technology Institute. 3 Aug 11. http://isc.sans.edu/diary.html?storyid=11305. Retrieved 31 Aug 11. 
  24. ^ "Barcode Scanner". Google. 1 Jun 11. https://market.android.com/details?id=com.google.zxing.client.android. Retrieved 31 Aug 11. 
  25. ^ "QR Droid". Google. 19 Aug 11. https://market.android.com/details?id=la.droid.qr. Retrieved 31 Aug 11. 
  26. ^ "ScanLife Barcode Reader". Google. 24 May 11. https://market.android.com/details?id=com.ScanLife. Retrieved 31 Aug 11. 
  27. ^ "Consumer Alert: QR Code Safety". Better Business Bureau. 23 Jun 11. http://sandiego.bbb.org/article/consumer-alert-qr-code-safety-28037. Retrieved 31 Aug 11. 
  28. ^ "AVG Cautions: Beware of Malicious QR Codes". PC World. 28 Jun 11. http://www.pcworld.idg.com.au/mediareleases/12655/avg-aunz-cautions-beware-of-malicious-qr-codes/. Retrieved 31 Aug 11. 
  29. ^ "EvilQR – When QRCode goes bad". AppSec-Labs Blog. 14 Aug 2011. https://appsec-labs.com/blog/tag/qrcode. Retrieved 31 Aug 2011. 
  30. ^ "QR Codes: A Recipe for a Mobile Malware Tsunami". Cyveillance, Inc. 20 Oct 2010. http://www.cyveillanceblog.com/malware/qr-codes-a-recipe-for-a-mobile-malware-tsunami. Retrieved 31 Aug 2011. 
  31. ^ QR Codes hold up to 2.9 KB whereas the smallest known computer virus is about one-tenth that size "The Smallest Virus I Could Manage". Virus Labs and Distribution. 1995. http://www.wiw.org/~meta/vlad.php?read=ARTICLE.5_2&issue=3&desc=Small%20Virus. Retrieved 31 Aug 2011. 
  32. ^ "Beware of Malicious QR Codes". ABC. 8 Jun 2011. http://www.abc.net.au/technology/articles/2011/06/08/3238443.htm. Retrieved 31 Aug 2011. 

Bibliography

External links